package com.mall.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mall.entity.Carousel;
import com.mall.pojo.ResponseMessage;
import com.mall.service.ICarouselService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  轮播图前端控制器
 * @author ShouPeng
 * @since 2024-01-14
 */
@RestController
@CrossOrigin
public class CarouselController {
    final
    ICarouselService carouselService;

    public CarouselController(ICarouselService carouselService) {
        this.carouselService = carouselService;
    }

    @GetMapping("/carousel")
    public ResponseMessage queryCarousel(){
        return ResponseMessage.success(carouselService.queryCarousel(new Page<Carousel>(1, 5)).getRecords());
    }

}

